<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<jsp:include page="/WEB-INF/jsp/common/_head.jsp" />
<%@ include file="/WEB-INF/jsp/common/_includes.jsp"%>
<div id="ly"
	style="position: absolute; top: 0px; filter: alpha(opacity = 60); background-color: #777; z-index: 2; left: 0px; display: none;">
</div>
<!--          浮层框架开始         -->  
<div id="Layer2" align="center"
	style="position: absolute; z-index: 3; left: 400px; top: 200px; background-color: #fff; display: none;">
	<form action="/order/phoneSent" class="form-horizontal" method="post"
		onsubmit="return dd()" target="_blank">
		<table width="540" height="230" border="0" cellpadding="0"
			cellspacing="0"
			style="border: 0 solid #e7e3e7; border-collapse: collapse;">
			<tr>
				<td
					style="background-color: #73A2d6; color: #fff; padding-left: 4px; padding-top: 2px; font-weight: bold; font-size: 12px;"
					height="10" valign="middle"><p align="center">发货手机信息录入</p>
					<div align="right">
						<a href="/order/list" class="STYLE1"  
							onclick="Lock_CheckForm(this);">[关闭]</a> &nbsp;&nbsp;&nbsp;&nbsp;
					</div></td>
			</tr>

			<tr>

				<td height="10" align="left"><label
					class="col-md-3 col-sm-3 control-label">电话：</label> <input
					class="form-control" name="phone" id="phone" style="width: 40%;" />
					<br /> <label class="col-md-3 col-sm-3 control-label">发送内容：</label>

					<textarea class="form-control" name="neirong" id="neirong"
						maxlength="20" rows="2" cols="10" style="width: 60%;"></textarea>
					<input value="${order.id }" name="orderId" id="orderId"
					type="hidden" /><br> <input class="btn btn-info"
					style="position: relative; left: 400px;" type="submit" value="发送" />
				</td>
			</tr>
		</table>
	</form>
</div>
<div class="ui grid">
	<div class="row">
		<div class="column">
			<div class="ui two column grid">
				<div class="three wide column">
					<jsp:include page="/WEB-INF/jsp/common/_sidebar.jsp">
						<jsp:param name="index" value="3000" />
					</jsp:include>
				</div>
				<div id="container" class="thirteen wide column">
					<ol class="breadcrumb">
						<li><a href="/order">众筹后台订单管理</a></li>
						<li class="active">订单管理  ${param.index} </li>
					</ol>

					<ul class="nav nav-pills" role="tablist">
						<li role="presentation" class="active">
							<form class="navbar-form navbar-left" role="search">
								<div>
									<div class="form-group">
										<input type="text" class="form-control" name="kw"
											value="${not empty param.kw ? param.kw : ''}"
											placeholder="请输人订单号 或 手机号码">
									</div>
									&nbsp; &nbsp; &nbsp;发货状态 : <select class="btn d" name="deliver"
										id="deliver" onchange="aa(this)">
										<option class="btn btn-default"
											<c:if test="${deliver==2}">selected="selected"</c:if>
											value="2">请选择</option>
										<option class="btn btn-default"
											<c:if test="${deliver==1}">selected="selected"</c:if>
											value="1">已发货</option>
										<option class="btn btn-default"
											<c:if test="${deliver==0}">selected="selected"</c:if>
											value="0">未发货</option>
									</select>&nbsp;&nbsp;
									<button type="submit" class="btn btn-default">搜索</button>
								</div>
							</form>
						</li>
					</ul>


					<table class="table table-hover">
						<thead>
							<tr>
								<th>订单编号</th>
								<th>订单生成时间</th>
								<th>数量</th>
								<th>支付金额</th>
								<th>收货人</th>
								<th>联系方式</th>
								<th>收货地址</th>
								<th>订单状态</th>
								<th>详情</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${paginate.pageList}" var="order">
								<tr>
									<td>${order.id}</td>
									<td><fmt:formatDate value="${order.createTime}"
											pattern="yyyy-MM-dd" /></td>
									<td>${order.buyNum}</td>
									<td>${order.amount}</td>
									<td>${order.consigneeName}</td>
									<td>${order.consigneeMobile}</td>
									<td>${order.consigneeAddress}</td>
									<td><c:choose>
											<c:when test="${order.payStatus==0}">
												<a class="btn btn-info js_broadcast">待支付</a>
											</c:when>
											<c:when test="${order.payStatus==1}">
												<a>支付中</a>
											</c:when>
											<c:when test="${order.payStatus==2}">
												<a>已支付</a>
											</c:when>
										</c:choose></td>
									<td><a href="/order/${order.id}/details" target="_blank">详情</a></td>
									<td><c:choose>
											<c:when test="${order.isDeliver==1}">
												<p class="btn btn-warning popover-toggle">已发货</p>
											</c:when>
											<c:when test="${order.isDeliver==0}">
												<button class="btn btn-primary  " data-toggle="modal"
													onclick="locking(${order.id},${order.consigneeMobile})"
													data-target="#myModal">发&nbsp;&nbsp;&nbsp;&nbsp;货</button>

												<%-- 										                                         <a  class="btn active btn-primary"  onclick="return confirm('确实要发货吗？')"  href="/order/${order.id}/update">未发货</a> --%>
											</c:when>
										</c:choose></td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
					<div class="page-info clearfix">${data }
						<jsp:include page="/WEB-INF/jsp/common/_page.jsp" />
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<jsp:include page="/WEB-INF/jsp/common/_foot.jsp"></jsp:include>
<script type="text/javascript" src="/static/js/page.js"></script>
<script type="text/javascript">
var regBox = {
		 regMobile : /^0?1[3|4|5|8][0-9]\d{8}$/
    }
function  dd(){
	if($("#neirong").val()==''){
		  alert("请输入内容");
		  return  false;
	  }
	var ph =$("#phone").val();
	var mflag = regBox.regMobile.test(ph);
	if(!mflag){
		 alert("手机号码输入有误");
		  return  false;
	}    
	
}
$(function () 
	      { $("[data-toggle='popover']").popover();
	      });
</script>
<script>   
  function    locking(obj,obj2){   
	  $("#orderId").val(obj); 
	 $("#phone").val(obj2);
	  
   document.all.ly.style.display="block";   
   document.all.ly.style.width=document.body.clientWidth;   
   document.all.ly.style.height=document.body.clientHeight;   
   document.all.Layer2.style.display='block';  
    
   }   
  function    Lock_CheckForm(theForm){   
   document.all.ly.style.display='none';document.all.Layer2.style.display='none';
  return   false;   
   }   
    </script>
